/*
 * @(#)DocRootTaglet.java 1.9 03/12/19
 * 
 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. SUN
 * PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

package com.sun.tools.doclets.internal.toolkit.taglets;

import com.sun.javadoc.*;

/**
 * An inline Taglet representing {&#064;docRoot}. This taglet is used to get the
 * relative path to the document's root output directory.
 * 
 * This code is not part of an API. It is implementation that is subject to
 * change. Do not use it as an API
 * 
 * @author Jamie Ho
 * @author Doug Kramer
 * @since 1.4
 */

public class DocRootTaglet extends BaseInlineTaglet {
	
	/**
	 * Construct a new DocRootTaglet.
	 */
	public DocRootTaglet() {
		name = "docRoot";
	}
	
	/**
	 * Given a <code>Doc</code> object, check if it holds any tags of this
	 * type. If it does, return the string representing the output. If it does
	 * not, return null.
	 * 
	 * @param tag a tag representing the custom tag.
	 * @param writer a {@link TagletWriter} Taglet writer.
	 * @return the string representation of this <code>Tag</code>.
	 */
	public TagletOutput getTagletOutput(Tag tag, TagletWriter writer) {
		return writer.getDocRootOutput();
	}
}
